package com.windgo.mapper;

import com.windgo.bean.MarketCouponUser;
import com.windgo.bean.MarketCouponUserExample;
import com.windgo.bean.wxVo.SelectListResponseVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MarketCouponUserMapper {
    long countByExample(MarketCouponUserExample example);

    int deleteByExample(MarketCouponUserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketCouponUser row);

    int insertSelective(MarketCouponUser row);

    List<MarketCouponUser> selectByExample(MarketCouponUserExample example);

    MarketCouponUser selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("row") MarketCouponUser row, @Param("example") MarketCouponUserExample example);

    int updateByExample(@Param("row") MarketCouponUser row, @Param("example") MarketCouponUserExample example);

    int updateByPrimaryKeySelective(MarketCouponUser row);

    int updateByPrimaryKey(MarketCouponUser row);


    // 2022/10/16 00点09分 mabai 根据用户id和优惠券id查询优惠券用户表中该用户含有该优惠券的数量
    int selectUserCouponReceiveCountByUserIdAndCouponId(@Param("currentUserId") Integer currentUserId, @Param("couponId") Integer couponId);

    int queryAvailableCoupon(Integer userId);
    // 2022-10-16 21点35分 mabai增加 根据用户id联合查询优惠券用户表和优惠券表中该用户未使用且当前时间可使用的优惠券list
    List<SelectListResponseVO> selectUserUnusedCouponByUserId(Integer currentUserId);
}